package com.own.business.system.dictionary.entity.map;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.own.business.system.dictionary.entity.po.SystemDictionaryItem;
import com.own.component.common.base.entity.BaseMap;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * SystemDictionaryItemMapVo
 *
 * @author chenxueli
 * @date 2023-06-21 09:42:25
 */
@Schema(title = "系统数据字典项目" + ConstantBeanSuffix.MAP_VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class SystemDictionaryItemMapVo extends BaseMap<SystemDictionaryItem> {

    @Schema(title = "字典id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long dictionaryId;

    @Schema(title = "项目名称")
    private String name;

    @Schema(title = "数据项值")
    private String value;

    @Schema(title = "图标")
    private String icon;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public SystemDictionaryItemMapVo(@NonNull SystemDictionaryItem entity) {
        super(entity);
        this.dictionaryId = entity.getFkDictionaryId();
        this.name = entity.getName();
        this.value = entity.getValue();
        this.icon = entity.getIcon();
    }
}
